<template>
  <div class="follow">
    <el-card>
      <post-list :post-list="postList"/>
    </el-card>
  </div>
</template>

<script>
import PostList from '@/components/PostList'
import { getId } from '@/utils/auth'
import { getFollowPost } from '@/api/post'
export default {
  components: { PostList },
  data () {
    return {
      postList: {}
    }
  },
  created () {
    this.getFollowPost()
  },
  methods: {
    async getFollowPost () {
      const res = await getFollowPost(getId())
      this.postList = res.postList
    }
  }
}
</script>

<style scoped>
.follow {
  width: 700px;
  margin: 20px auto;
}
</style>
